package com.matrix.common.exception;

import com.matrix.common.enums.ErrorCode;
import lombok.Getter;

/**
 * @author 有点甜
 * @since 2025/7/25
 */
@Getter
public class BusinessException extends RuntimeException {
    private final ErrorCode errorCode;

    public BusinessException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }

    public BusinessException(String message) {
        super(message);
        this.errorCode = ErrorCode.BUSINESS_ERROR;
    }
}
